﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


    class ParseURL
    {
        static void Main(string[] args)
        {
            string url = "http://yahoo.com/mail";
            int index = 0;
            index = url.IndexOf(':');
            Console.WriteLine("[protocol] = \"{0}\"", url.Substring(0, index));
            url = url.Replace(url.Substring(0, index+3), "");

            index = url.IndexOf('/');            
            Console.WriteLine("[server]=\"{0}\"", url.Substring(0,index));
            url = url.Replace(url.Substring(0, index+1), "");
            Console.WriteLine("[resource]= \"{0}\"", url);
        }
    }

